﻿<UserControl
    x:Class="BootyShaker.SettingsScreen"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:BootyShaker"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"

    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
    <!--SupportedOrientations="Portrait" Orientation="Portrait"-->
    <UserControl.Resources>


        <Storyboard x:Name="Hide">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="500"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0" >
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Show"  Completed="Show_Completed">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="500"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LayoutRoot">
                <DiscreteObjectKeyFrame KeyTime="0" >
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

        <local:AppSettings x:Key="appSettings"></local:AppSettings>
    </UserControl.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" >
        <Grid.RenderTransform>
            <TranslateTransform/>
        </Grid.RenderTransform>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
       
        <Grid Margin="12,17,0,28">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Grid x:Name="btnBack" Margin="10,10,10,10" Grid.Column="0" VerticalAlignment="Bottom"  Tap="btnBack_Tap">
                <Image   Stretch="None" Source="/Icons/appbar.back.rest.png"  HorizontalAlignment="Left" />
                <Image   Stretch="None" Source="/BootyShaker;component/Icons/appbar.basecircle.rest.png"  HorizontalAlignment="Left" />
            </Grid>
           
            <StackPanel Grid.Column="1" x:Name="TitlePanel" Grid.Row="0" >
                <!--<TextBlock Foreground="White" x:Name="ApplicationTitle" Text="BootyShaker" Style="{StaticResource PhoneTextNormalStyle}"/>-->
                <TextBlock Foreground="White" x:Name="PageTitle" Text="Settings" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
            </StackPanel>

        </Grid>
        
       
       
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer     ScrollViewer.VerticalScrollBarVisibility="Hidden" Grid.Row="1" Margin="0,0,0,10">
                <StackPanel>
                    <TextBlock Foreground="White" x:Name="label6" Text="Merge/Overlay" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <toolkit:ToggleSwitch x:Name="MergeOverlay" Foreground="White"                                        
                     Content="Merge"                      
                     Checked="ToggleSwitch_Checked" 
                     Unchecked="ToggleSwitch_Unchecked" IsChecked="{Binding Path=MergeOverlaySetting, Mode=TwoWay, Source={StaticResource appSettings}}" FontSize="24"/>

                    <TextBlock Foreground="White" x:Name="label1" Text="Gravity ratio" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <Slider Name="GravityRatio" Tag="label1" Minimum="100" Maximum="500" SmallChange="1" LargeChange="10" 
                            Value="{Binding Path=GravityRatioSetting, Mode=TwoWay, Source={StaticResource appSettings}}" ValueChanged="slider_ValueChanged" />
                    <TextBlock Foreground="White" x:Name="label2" Text="Damping ratio" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <Slider Name="DampingRatio" Tag="label2" Minimum="0.1" Maximum="2" SmallChange="0.05" LargeChange="0.5" 
                            Value="{Binding Path=DampingRatioSetting, Mode=TwoWay, Source={StaticResource appSettings}}" ValueChanged="slider_ValueChanged" />
                    <TextBlock Foreground="White" x:Name="label3" Text="Frequency/Weight" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <Slider Name="Frequency" Tag="label3" Minimum="4" Maximum="9.0" SmallChange="0.1" LargeChange="0.5" 
                            Value="{Binding Path=FrequencySetting, Mode=TwoWay, Source={StaticResource appSettings}}" ValueChanged="slider_ValueChanged" />
                    <TextBlock Foreground="White" x:Name="label5" Text="Drag strength" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <Slider Name="DragStrength" Tag="label5" Minimum="100" Maximum="500" SmallChange="1" LargeChange="10" 
                            Value="{Binding Path=DragStrengthSetting, Mode=TwoWay, Source={StaticResource appSettings}}" ValueChanged="slider_ValueChanged" />

                    <!--<TextBlock x:Name="label6" Text="Linear damping" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
                    <Slider Name="LinearDamping" Tag="label6" Minimum="0" Maximum="2" SmallChange="0.1" LargeChange="0.5" 
                            Value="{Binding Path=LinearDampingSetting, Mode=TwoWay, Source={StaticResource appSettings}}" ValueChanged="slider_ValueChanged" />-->

                </StackPanel>
            </ScrollViewer>
        </Grid>
        <!--<Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#ed8383" Offset="0" />
                <GradientStop Color="#dc9094" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>-->
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="#FF86304B" ForegroundColor="Pink">
            <shell:ApplicationBar.Buttons>
                <shell:ApplicationBarIconButton IconUri="/Icons/appbar.reset.rest.png" Text="Defaults" Click="btnDefaults_click" />
                
            </shell:ApplicationBar.Buttons>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</UserControl>
